import Vue from 'vue';
import Router from 'vue-router';
import Home from './views/Home.vue';
// auth
import Auth from './views/Auth.vue';
import AuthLogin from './components/auth/AuthLogin.vue';
import AuthRegister from './components/auth/AuthRegister.vue';
import AuthPasswordForgot from './components/auth/AuthPasswordForgot.vue';
import AuthPasswordReset from './components/auth/AuthPasswordReset.vue';
// errors
import Error401 from './views/errors/401.vue';
import Error403 from './views/errors/403.vue';
import Error404 from './views/errors/404.vue';
import Error419 from './views/errors/419.vue';
import Error429 from './views/errors/429.vue';
import Error500 from './views/errors/500.vue';
import Error503 from './views/errors/503.vue';
// updates
import Updates from './views/Updates.vue';
// plugin
import Scene from './components/plugin/Scene.vue';
import Earth from './components/plugin/Earth.vue';

Vue.use(Router);

export default new Router({
    mode: 'history',
    base: process.env.BASE_URL,
    routes: [
        {
            path: '/',
            name: 'home',
            component: Home,
        },
        {
            path: '/auth',
            component: Auth,
            children: [
                {
                    path: '',
                    redirect: 'login',
                },
                {
                    path: 'login',
                    component: AuthLogin,
                },
                {
                    path: 'register',
                    component: AuthRegister,
                },
                {
                    path: 'password-forgot',
                    component: AuthPasswordForgot,
                },
                {
                    path: 'password-reset',
                    component: AuthPasswordReset,
                },
            ],
        },
        /**
         * 针对开发者：
         *
         * 下面两个路由是测试用的，可删除。
         */
        {
            path: '/plugin/scene',
            component: Scene,
        },
        {
            path: '/plugin/earth',
            component: Earth,
        },
        /**
         * 针对开发者：
         *
         * 好了！请不要再继续编辑。请保存本文件。使用愉快！
         */
        {
            path: '/updates',
            component: Updates,
        },
        {
            path: '/401',
            component: Error401,
        },
        {
            path: '/403',
            component: Error403,
        },
        {
            path: '/419',
            component: Error419,
        },
        {
            path: '/429',
            component: Error429,
        },
        {
            path: '/500',
            component: Error500,
        },
        {
            path: '/503',
            component: Error503,
        },
        {
            path: '*',
            component: Error404,
        },
    ],
});
